package cn.etg.test;

import java.util.Arrays;
import java.util.List;

public class test {
    public static void main(String[] args) {
        String str = "  as123As   ";
        System.out.println(str.replace("as", "bb"));
        System.out.println(str.replaceAll("[0-9]+", "good"));
        System.out.println(str.toLowerCase());
        System.out.println(str.toUpperCase());
        System.out.println(str.trim());
        System.out.println(Arrays.toString(str.split("")));
        System.out.println(str.substring(5));
        System.out.println(str.substring(3, 4));
        String str1 = "";
        System.out.println(str1.equals(""));
        System.out.println(str1 == "");
        System.out.println(str1.isEmpty());
        System.out.println(str.length());
        System.out.println(str.indexOf("s"));
        str.charAt(4);
        char[] chars = {'1', '2', '3'};
        System.out.println(String.valueOf(chars));
        System.out.println(String.valueOf(chars) instanceof String);
        char[] chars1 = str.toCharArray();
        for (int i = 0; i < chars1.length; i++) {
            System.out.println(chars1[i]);
        }
        // 输出是1不是3
        System.out.print("输出： ");
        System.out.println(Arrays.toString(chars));
        List list = Arrays.asList(chars);
        System.out.println(list.size());
    }
}
